import { CallHandler, ExecutionContext, Injectable, NestInterceptor } from "@nestjs/common";
import { log } from "console";
import { Observable } from "rxjs";

// 请求拦截器
@Injectable()
export class LoggingInterceptor implements NestInterceptor {
  intercept(context: ExecutionContext, next: CallHandler<any>): Observable<any> | Promise<Observable<any>> {

    log('Request...', context.switchToHttp().getRequest().url)

    return next.handle()
  }
}